inherited fmRaspred_misc: TfmRaspred_misc
  Left = 488
  Top = 179
  Width = 1371
  Height = 900
  Caption = #1056#1072#1089#1087#1088#1077#1076#1077#1083#1077#1085#1080#1077' '#1076#1077#1090#1077#1081' '#1087#1086' '#1076#1086#1087#1086#1083#1085#1080#1090#1077#1083#1100#1085#1099#1084' '#1087#1086#1076#1088#1072#1079#1076#1077#1083#1077#1085#1080#1103#1084
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 835
    Width = 1355
  end
  inherited Panel1: TPanel
    Top = 790
    Width = 1355
    Align = alBottom
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 1193
    end
    inherited BitBtn2: TBitBtn
      Left = 1281
    end
  end
  object Panel2: TPanel [2]
    Left = 0
    Top = 0
    Width = 385
    Height = 790
    Align = alLeft
    TabOrder = 2
    object dbTW: TdxDBTreeView
      Left = 1
      Top = 1
      Width = 383
      Height = 321
      ShowNodeHint = True
      RowSelect = True
      DataSource = dsSD
      DisplayField = 'SDNAME'
      KeyField = 'SDID'
      ListField = 'SDNAME'
      ParentField = 'SDPARID'
      RootValue = 0
      SeparatedSt = '-'
      StateIndexField = 'SDISDELETE'
      RaiseOnError = True
      ReadOnly = True
      Indent = 19
      Align = alTop
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -13
      Font.Name = 'Arial'
      Font.Style = []
      ParentColor = False
      Options = [trCanDBNavigate]
      SelectedIndex = 1
      TabOrder = 0
      OnClick = dbTWClick
      ParentFont = False
      ParentShowHint = False
      ShowHint = False
      StateImages = DMInv.ilBJTree
    end
    object cxDBImage1: TcxDBImage
      Left = 1
      Top = 322
      Align = alTop
      DataBinding.DataField = 'PPIMAGE'
      DataBinding.DataSource = dsPhoto
      Properties.GraphicClassName = 'TJPEGImage'
      TabOrder = 1
      Height = 249
      Width = 383
    end
    object cxGrid3: TcxGrid
      Left = 1
      Top = 571
      Width = 383
      Height = 218
      Align = alClient
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
      TabOrder = 2
      TabStop = False
      LookAndFeel.Kind = lfStandard
      object cxGridDBTableView3: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        DataController.DataSource = dsVizit
        DataController.Summary.DefaultGroupSummaryItems = <>
        DataController.Summary.FooterSummaryItems = <>
        DataController.Summary.SummaryGroups = <>
        OptionsBehavior.CellHints = True
        OptionsBehavior.ImmediateEditor = False
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsData.Deleting = False
        OptionsData.Inserting = False
        OptionsView.NavigatorOffset = 10
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.CellAutoHeight = True
        OptionsView.ColumnAutoWidth = True
        OptionsView.GroupByBox = False
        OptionsView.Indicator = True
        OptionsView.ShowColumnFilterButtons = sfbAlways
        Preview.Visible = True
        object cxGridDBTableView3PVTIME_IN: TcxGridDBColumn
          Caption = #1042#1093#1086#1076
          DataBinding.FieldName = 'PVTIME_IN'
          Width = 61
        end
        object cxGridDBTableView3PVTIME_OUT: TcxGridDBColumn
          Caption = #1042#1099#1093#1086#1076
          DataBinding.FieldName = 'PVTIME_OUT'
          Width = 71
        end
      end
      object cxGridLevel3: TcxGridLevel
        GridView = cxGridDBTableView3
      end
    end
  end
  object Panel6: TPanel [3]
    Left = 393
    Top = 0
    Width = 962
    Height = 790
    Align = alClient
    Caption = 'Panel6'
    TabOrder = 3
    object cxGrid1: TcxGrid
      Left = 1
      Top = 50
      Width = 960
      Height = 495
      Align = alTop
      TabOrder = 0
      LookAndFeel.Kind = lfStandard
      object tvRaspr: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.CustomizeDialog = False
        FilterBox.Visible = fvNever
        OnCellClick = tvRasprCellClick
        OnCellDblClick = tvRasprCellDblClick
        DataController.DataSource = dsTemp
        DataController.Summary.DefaultGroupSummaryItems = <
          item
            Kind = skCount
            Position = spFooter
            FieldName = 'PP'
          end>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'PLASTNAME'
            Column = tvRasprPLASTNAME
          end>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        OptionsBehavior.CellHints = True
        OptionsBehavior.ImmediateEditor = False
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.CancelOnExit = False
        OptionsData.Deleting = False
        OptionsData.Editing = False
        OptionsData.Inserting = False
        OptionsSelection.HideFocusRectOnExit = False
        OptionsSelection.InvertSelect = False
        OptionsSelection.UnselectFocusedRecordOnExit = False
        OptionsView.FocusRect = False
        OptionsView.NavigatorOffset = 10
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.ColumnAutoWidth = True
        OptionsView.DataRowHeight = 24
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Content = DMInv.cxData
        Styles.Inactive = DMInv.cxWhite
        Styles.IncSearch = DMInv.cxKrasniyText
        Styles.Selection = DMInv.cxJoltiyFon
        Styles.Header = DMInv.cxSiniyText
        object tvRasprNum: TcxGridDBColumn
          Caption = #8470
          OnGetDataText = tvRasprNumGetDataText
          Options.IncSearch = False
          Options.Sorting = False
          Width = 22
        end
        object tvRasprPLASTNAME: TcxGridDBColumn
          DataBinding.FieldName = 'PLASTNAME'
          Width = 55
        end
        object tvRasprPNAME: TcxGridDBColumn
          DataBinding.FieldName = 'PNAME'
          Width = 27
        end
        object tvRasprPPATRONYMIC: TcxGridDBColumn
          DataBinding.FieldName = 'PPATRONYMIC'
          Width = 60
        end
        object tvRasprPDATEBIRTH: TcxGridDBColumn
          DataBinding.FieldName = 'PDATEBIRTH'
          Width = 72
        end
        object tvRasprLET: TcxGridDBColumn
          Caption = #1051#1077#1090
          DataBinding.FieldName = 'LET'
          Width = 27
        end
        object tvRasprMES: TcxGridDBColumn
          Caption = #1052#1077#1089'.'
          DataBinding.FieldName = 'MES'
          Width = 32
        end
        object tvRasprDPDATEIN: TcxGridDBColumn
          Caption = #1044#1072#1090#1072' '#1079#1072#1095'.'
          DataBinding.FieldName = 'DPDATEIN'
          Width = 61
        end
        object tvRasprINNOTE: TcxGridDBColumn
          Caption = #1050#1086#1084#1084#1077#1085#1090'.'
          DataBinding.FieldName = 'INNOTE'
          Width = 58
        end
        object tvRasprDPDATEOUT: TcxGridDBColumn
          DataBinding.FieldName = 'DPDATEOUT'
          Width = 68
        end
        object tvRasprOUTNOTE: TcxGridDBColumn
          DataBinding.FieldName = 'OUTNOTE'
          Width = 88
        end
        object tvRasprPODR: TcxGridDBColumn
          Caption = #1055#1086#1076#1088'.'
          DataBinding.FieldName = 'PODR'
          Width = 39
        end
        object tvRasprOSN_PODR: TcxGridDBColumn
          Caption = #1054#1089#1085'. '#1087#1086#1076#1088'.'
          DataBinding.FieldName = 'OSN_PODR'
          Width = 61
        end
      end
      object cxGridLevel1: TcxGridLevel
        GridView = tvRaspr
      end
    end
    object Panel4: TPanel
      Left = 1
      Top = 545
      Width = 960
      Height = 49
      Align = alTop
      TabOrder = 1
      object cxButton1: TcxButton
        Left = 124
        Top = 2
        Width = 133
        Height = 43
        Caption = #1042#1082#1083'.'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -19
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 0
        Visible = False
        OnClick = cxButton1Click
        Glyph.Data = {
          56020000424D560200000000000076000000280000001E0000001E0000000100
          040000000000E001000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00000000000000
          0000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFF000077888888888
          8888888888888888F0000778888000000000000000000888F00007788880FFFF
          FFFFFFFFFFFF0888F00007788880FFFFFFFFFFFFFFFF0888F00007788880FFFF
          FF88888FFFFF0888F00007788880FFFFF000008FFFFF0888F00007788880FFFF
          F066608FFFFF0888F00007788880FFFFF066608FFFFF0888F00A07788880FFFF
          F066608FFFFF0888F02C07788880FFFFF066608FFFFF0888F04C07788880FFFF
          F066608FFFFF0888F09007788880FFF88066608888FF0888F0A807788880FF00
          006660000FFF0888F01507788880FFF066666660FFFF0888F04207788880FFFF
          0666660FFFFF0888F0AE07788880FFFFF06660FFFFFF0888F00007788880FFFF
          FF060FFFF8880888F02507788880FFFFFFF0FFFFF8880888F09907788880FFFF
          FFFFFFFF00070888F09907788880FFFFFFFFFFFF0FF08888F0FB07788880FFFF
          FFFFFFFF0F088888F0FB07788880FFFFFFFFFFFF70888888F0C8077888800000
          0000000008888888F0000778888888888888888888888888F000077888888888
          8888888888888888F0000777777777777777777777777777F000077777777777
          7777777777777777700000000000000000000000000000000000}
        Layout = blGlyphRight
        LookAndFeel.SkinName = 'GlassOceans'
      end
      object cxButton5: TcxButton
        Left = 407
        Top = 2
        Width = 96
        Height = 43
        Caption = #1048#1089#1082#1083'.'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -19
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 1
        Visible = False
        OnClick = cxButton5Click
        Colors.Default = clRed
        Glyph.Data = {
          56020000424D560200000000000076000000280000001E0000001E0000000100
          040000000000E001000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00000000000000
          0000000000000000000007FFFFFFFFFFFFFFFFFFFFFFFFFFF000077888888888
          8888888888888888F0000778888000000000000008888888F00007788880FFFF
          FFFFFFFF70888888F00007788880FFFFFFFFFFFF0F088888F00007788880FFFF
          FFFFFFFF0FF08888F00007788880FFFFFFFF8FFF00070888F00007788880FFFF
          FFF088FFFFFF0888F00007788880FFFFFF06088FFFFF0888F00007788880FFFF
          F0666088FFFF0888F00007788880FFFF066666088FFF0888F00007788880FFF0
          6666666088FF0888F00007788880FF00006660000FFF0888F00007788880FFFF
          F066608FFFFF0888F00007788880FFFFF066608FFFFF0888F00007788880FFFF
          F066608FFFFF0888F00007788880FFFFF066608FFFFF0888F0C507788880FFFF
          F066608FFFFF0888F04A07788880FFFFF066608FFFFF0888F06507788880FFFF
          F00000FFFFFF0888F00007788880FFFFFFFFFFFFFFFF0888F00007788880FFFF
          FFFFFFFFFFFF0888F00007788880FFFFFFFFFFFFFFFF0888F000077888800000
          0000000000000888F0000778888888888888888888888888F000077888888888
          8888888888888888F0000777777777777777777777777777F000077777777777
          7777777777777777700000000000000000000000000000000000}
        Layout = blGlyphRight
        LookAndFeel.SkinName = 'DarkSide'
      end
    end
    object Panel5: TPanel
      Left = 1
      Top = 594
      Width = 960
      Height = 34
      Align = alTop
      TabOrder = 2
      Visible = False
      object Edit1: TEdit
        Left = 16
        Top = 2
        Width = 316
        Height = 27
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -16
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 0
        OnChange = Edit1Change
      end
    end
    object dbgClients: TcxGrid
      Left = 1
      Top = 628
      Width = 240
      Height = 161
      Align = alLeft
      TabOrder = 3
      Visible = False
      LookAndFeel.Kind = lfStandard
      object tvPeople: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.CustomizeDialog = False
        FilterBox.Visible = fvNever
        OnCellClick = tvPeopleCellClick
        OnCellDblClick = tvPeopleCellDblClick
        DataController.DataSource = dlgDS
        DataController.Summary.DefaultGroupSummaryItems = <
          item
            Kind = skCount
            Position = spFooter
            FieldName = 'PLASTNAME'
          end>
        DataController.Summary.FooterSummaryItems = <
          item
            Kind = skCount
            FieldName = 'PLASTNAME'
            Column = tvPeoplePLASTNAME
          end>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        OptionsBehavior.CellHints = True
        OptionsBehavior.ImmediateEditor = False
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.CancelOnExit = False
        OptionsData.Deleting = False
        OptionsData.Editing = False
        OptionsData.Inserting = False
        OptionsSelection.CellSelect = False
        OptionsSelection.HideFocusRectOnExit = False
        OptionsSelection.InvertSelect = False
        OptionsSelection.UnselectFocusedRecordOnExit = False
        OptionsView.FocusRect = False
        OptionsView.NavigatorOffset = 10
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.ColumnAutoWidth = True
        OptionsView.DataRowHeight = 24
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Content = DMInv.cxData
        Styles.Inactive = DMInv.cxWhite
        Styles.IncSearch = DMInv.cxKrasniyText
        Styles.Selection = DMInv.cxJoltiyFon
        Styles.Header = DMInv.cxSiniyText
        object tvPeopleNum11: TcxGridDBColumn
          Caption = #8470
          OnGetDataText = tvPeopleNum11GetDataText
          Options.IncSearch = False
          Options.Sorting = False
          Width = 46
        end
        object tvPeoplePLASTNAME: TcxGridDBColumn
          DataBinding.FieldName = 'PLASTNAME'
          Width = 114
        end
        object tvPeoplePNAME: TcxGridDBColumn
          DataBinding.FieldName = 'PNAME'
          Width = 58
        end
        object tvPeoplePPATRONYMIC: TcxGridDBColumn
          DataBinding.FieldName = 'PPATRONYMIC'
          Width = 125
        end
        object tvPeoplePDATEBIRTH: TcxGridDBColumn
          DataBinding.FieldName = 'PDATEBIRTH'
          Width = 152
        end
        object tvPeopleLET: TcxGridDBColumn
          DataBinding.FieldName = 'LET'
          Width = 57
        end
        object tvPeopleMES: TcxGridDBColumn
          DataBinding.FieldName = 'MES'
          Width = 57
        end
        object tvPeopleOSN_PODR: TcxGridDBColumn
          Caption = #1054#1089#1085'. '#1087#1086#1076#1088'.'
          DataBinding.FieldName = 'OSN_PODR'
          Width = 61
        end
      end
      object dbgClientsLevel1: TcxGridLevel
        GridView = tvPeople
      end
    end
    object Panel3: TPanel
      Left = 1
      Top = 1
      Width = 960
      Height = 49
      Align = alTop
      TabOrder = 4
      DesignSize = (
        960
        49)
      object Label1: TLabel
        Left = 285
        Top = 16
        Width = 109
        Height = 16
        Caption = #1044#1072#1085#1085#1099#1077' '#1085#1072' '#1076#1072#1090#1091
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clGray
        Font.Height = -13
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
      end
      object cxDBTextEdit1: TcxDBTextEdit
        Left = 8
        Top = 12
        DataBinding.DataField = 'SDNAME'
        DataBinding.DataSource = dsSD
        ParentFont = False
        Properties.ReadOnly = True
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clGreen
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.TextColor = clRed
        Style.TextStyle = [fsBold]
        Style.IsFontAssigned = True
        TabOrder = 0
        Width = 273
      end
      object cxDateEdit1: TcxDateEdit
        Left = 398
        Top = 10
        ParentFont = False
        Properties.InputKind = ikMask
        Properties.OnChange = dbTWClick
        Style.Font.Charset = DEFAULT_CHARSET
        Style.Font.Color = clRed
        Style.Font.Height = -16
        Style.Font.Name = 'Tahoma'
        Style.Font.Style = []
        Style.TextStyle = [fsBold]
        Style.IsFontAssigned = True
        TabOrder = 1
        Width = 123
      end
      object bReload: TcxButton
        Left = 803
        Top = 5
        Width = 111
        Height = 37
        Anchors = [akTop, akRight]
        Caption = #1054#1073#1085#1086#1074#1080#1090#1100
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 2
        OnClick = dbTWClick
        Glyph.Data = {
          DE010000424DDE01000000000000760000002800000024000000120000000100
          0400000000006801000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444
          33333333333F7777773F33330000324334222222443333377F3733333377F333
          000032244222222222433337F7733FFFFF337F3300003222222AAAAA22243337
          F333F77777F337F30000322222A33333A2224337F33F7333337F337F00003222
          223333333A224337F33733333337F37F00003222222333333A444337FFFF7F33
          3337777300003AAAAAAA33333333333777777733333333330000333333333333
          333333333333333333FFFFFF000033333333333344444433FFFF333333777777
          00003A444333333A22222437777F333337F3333700003A2243333333A2222437
          F37F333333733337000033A224333334422224337337FFFFF7733337000033A2
          22444442222224337F3377777333FF370000333A2222222222AA243337FF3333
          33FF77F700003333AA222222AA33A3333377FFFFFF7733730000333333AAAAAA
          3333333333337777773333330000333333333333333333333333333333333333
          0000}
        LookAndFeel.SkinName = 'Caramel'
        NumGlyphs = 2
      end
      object cxButton2: TcxButton
        Left = 675
        Top = 5
        Width = 121
        Height = 37
        Anchors = [akTop, akRight]
        Caption = #1055#1077#1088#1077#1074#1086#1076
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -19
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 3
        Visible = False
        OnClick = cxButton2Click
        Glyph.Data = {
          26050000424D260500000000000036040000280000000F0000000F0000000100
          080000000000F0000000C30E0000C30E00000001000000000000FFFFFF00C9E1
          B600C5C5C5008E93EB00A9A9AE00848C8C00559F1D002830DE00000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000000000000000
          0000000000000000000000000000000000000000000000000000010505050505
          0505040505050505020005050202020202020202020202050500050200000000
          0000000000050102050005020000000000000000060601020500050200070000
          0000000606060102050005020007030000000606060601020500050200070703
          0001060606060102050005020007070703000106060601020500040200070707
          0707000106060102050005020007070707030000010601020500050200070707
          0300000000060102050005020007070300000000000000020500050200070400
          0000000000000002050005050204020202020202020202050500020505050505
          05050505050505050200}
        Layout = blGlyphRight
        LookAndFeel.SkinName = 'GlassOceans'
      end
      object bExcell: TcxButton
        Left = 927
        Top = 4
        Width = 27
        Height = 37
        Anchors = [akTop, akRight]
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 4
        OnClick = bExcellClick
        Glyph.Data = {
          F6000000424DF600000000000000760000002800000010000000100000000100
          0400000000008000000000000000000000001000000000000000000000000000
          8000008000000080800080000000800080008080000080808000C0C0C0000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333300003
          30003333000088000EE033330FFF0880EE0033330F77708EE00333330FFFF0EE
          800333000F770EE0880033090FF0EE0F0880000990F000FFF00009999907FF77
          7F0309999990FFFFFF030999990FF7000003000990FFFF0FF03333090FFF770F
          033333000FFFFF00333333330000000333333333333333333333}
        LookAndFeel.SkinName = 'Caramel'
      end
    end
    object dbgSC: TcxGrid
      Left = 241
      Top = 628
      Width = 720
      Height = 161
      Align = alClient
      TabOrder = 5
      LookAndFeel.Kind = lfStandard
      object tvSC: TcxGridDBTableView
        NavigatorButtons.ConfirmDelete = False
        NavigatorButtons.First.Visible = True
        NavigatorButtons.PriorPage.Visible = True
        NavigatorButtons.Prior.Visible = True
        NavigatorButtons.Next.Visible = True
        NavigatorButtons.NextPage.Visible = True
        NavigatorButtons.Last.Visible = True
        NavigatorButtons.Insert.Visible = False
        NavigatorButtons.Append.Visible = False
        NavigatorButtons.Delete.Visible = False
        NavigatorButtons.Edit.Visible = False
        NavigatorButtons.Post.Visible = False
        NavigatorButtons.Cancel.Visible = False
        NavigatorButtons.Refresh.Visible = False
        NavigatorButtons.SaveBookmark.Visible = False
        NavigatorButtons.GotoBookmark.Visible = False
        NavigatorButtons.Filter.Visible = False
        FilterBox.CustomizeDialog = False
        FilterBox.Visible = fvNever
        DataController.DataSource = dsSC
        DataController.Summary.DefaultGroupSummaryItems = <
          item
            Kind = skCount
            Position = spFooter
            FieldName = 'PLASTNAME'
          end>
        DataController.Summary.FooterSummaryItems = <>
        DataController.Summary.SummaryGroups = <>
        DataController.Summary.Options = [soNullIgnore]
        OptionsBehavior.CellHints = True
        OptionsBehavior.ImmediateEditor = False
        OptionsBehavior.IncSearch = True
        OptionsCustomize.ColumnFiltering = False
        OptionsCustomize.ColumnGrouping = False
        OptionsData.CancelOnExit = False
        OptionsData.Deleting = False
        OptionsData.Editing = False
        OptionsData.Inserting = False
        OptionsSelection.CellSelect = False
        OptionsSelection.HideFocusRectOnExit = False
        OptionsSelection.InvertSelect = False
        OptionsSelection.UnselectFocusedRecordOnExit = False
        OptionsView.FocusRect = False
        OptionsView.NavigatorOffset = 10
        OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
        OptionsView.ColumnAutoWidth = True
        OptionsView.DataRowHeight = 24
        OptionsView.ExpandButtonsForEmptyDetails = False
        OptionsView.Footer = True
        OptionsView.GroupByBox = False
        OptionsView.Indicator = True
        Preview.Visible = True
        Styles.Content = DMInv.cxData
        Styles.Inactive = DMInv.cxWhite
        Styles.IncSearch = DMInv.cxKrasniyText
        Styles.Selection = DMInv.cxJoltiyFon
        Styles.Header = DMInv.cxSiniyText
        object tvSCSCID: TcxGridDBColumn
          Caption = #8470' '#1089#1082#1074#1079#1085
          DataBinding.FieldName = 'SCID'
          Width = 87
        end
        object tvSCSCDATEBEGIN: TcxGridDBColumn
          Caption = #1044#1072#1090#1072' '#1085#1072#1095#1072#1083#1072
          DataBinding.FieldName = 'SCDATEBEGIN'
          Width = 216
        end
        object tvSCSCDATEEND: TcxGridDBColumn
          Caption = #1044#1072#1090#1072' '#1079#1072#1074#1077#1088#1096'.'
          DataBinding.FieldName = 'SCDATEEND'
          Width = 187
        end
        object tvSCSTNAME: TcxGridDBColumn
          Caption = #1053#1072#1079#1074#1072#1085#1080#1077' '#1091#1089#1083#1091#1075#1080
          DataBinding.FieldName = 'STNAME'
          Width = 133
        end
        object tvSCSCOUNT: TcxGridDBColumn
          Caption = #1050#1086#1083#1080#1095'.'
          DataBinding.FieldName = 'SCOUNT'
          Width = 47
        end
      end
      object cxGridLevel2: TcxGridLevel
        GridView = tvSC
      end
    end
  end
  object cxSplitter1: TcxSplitter [4]
    Left = 385
    Top = 0
    Width = 8
    Height = 790
    Control = Panel2
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
    Left = 400
    Top = 680
  end
  object qTree: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dsSD
    SQL.Strings = (
      'SELECT LIST(t1.sdid, '#39', '#39') AS list_sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = :SDID'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE NOT EXISTS'
      '('
      'SELECT t2.sdid'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = :SDID'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t2'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'WHERE t2.sdparid = t1.sdid'
      ')')
    GeneratorField.Field = 'SDID'
    Left = 248
    Top = 336
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'SDID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'SDID'
        ParamType = ptUnknown
      end>
    object qTreeLIST_SDID: TMemoField
      FieldName = 'LIST_SDID'
      ProviderFlags = []
      BlobType = ftMemo
      Size = 8
    end
  end
  object qSD: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID)'
      '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 14'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, SDPARID'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    GeneratorField.Field = 'SDID'
    Left = 208
    Top = 336
    object qSDSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qSDSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qSDSDNAME: TIBStringField
      DisplayLabel = #1069#1083#1077#1084#1077#1085#1090
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qSDSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsSD: TDataSource
    DataSet = qSD
    Left = 168
    Top = 336
  end
  object dsTemp: TDataSource
    DataSet = qTemp
    OnDataChange = dsTempDataChange
    Left = 792
    Top = 72
  end
  object qTemp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT DP.*,  P.PID, P.PLASTNAME, P.PNAME, P.PPATRONYMIC, P.PDAT' +
        'EBIRTH,  (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39'))' +
        ' AS PP, IIF((DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) ' +
        '-'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)-1,'
      '     DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)) AS let,'
      '     IIF( (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, 12 + (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)), ' +
        '(DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) )' +
        ' AS mes,'
      '     SD.SDNAME, SD1.SDNAME AS step_act,'
      '     SD3.SDNAME AS podr, SD4.SDNAME AS osn_podr'
      'FROM DETI_PODRAZD_MISC DP'
      'INNER JOIN PEOPLE P ON P.PID = DP.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'LEFT OUTER JOIN P_STEPACT PA ON PA.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD1 ON SD1.SDID = PA.PSTEP'
      'LEFT OUTER JOIN SYS_DIC SD3 ON SD3.SDID = DP.SDID'
      
        'LEFT OUTER JOIN DETI_PODRAZD DPM ON DPM.PID = P.PID AND :data BE' +
        'TWEEN CAST(dpm.DPDATEIN AS DATE) AND COALESCE(CAST(dpm.DPDATEOUT' +
        ' AS DATE), CURRENT_DATE+3650)'
      'LEFT OUTER JOIN SYS_DIC SD4 ON SD4.SDID = DPM.SDID'
      
        'WHERE :data BETWEEN CAST(DP.DPDATEIN AS DATE) AND COALESCE(CAST(' +
        'DP.DPDATEOUT AS DATE), CURRENT_DATE+3650)'
      ' and P.PISDELETE IS NULL ')
    UpdateObject = IBUpdateSQL1
    GeneratorField.Field = 'DPID'
    GeneratorField.Generator = 'GEN_DETI_PODRAZD_MISC_ID'
    Left = 824
    Top = 72
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end>
    object qTempDPID: TIntegerField
      FieldName = 'DPID'
      Origin = '"DETI_PODRAZD"."DPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qTempPID: TIntegerField
      FieldName = 'PID'
      Origin = '"DETI_PODRAZD"."PID"'
    end
    object qTempSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"DETI_PODRAZD"."SDID"'
    end
    object qTempDPDATEIN: TDateTimeField
      FieldName = 'DPDATEIN'
      Origin = '"DETI_PODRAZD"."DPDATEIN"'
    end
    object qTempINNOTE: TIBStringField
      FieldName = 'INNOTE'
      Origin = '"DETI_PODRAZD"."INNOTE"'
      Size = 255
    end
    object qTempDPDATEOUT: TDateTimeField
      DisplayLabel = #1044#1072#1090#1072'  '#1074#1099#1073'.'
      FieldName = 'DPDATEOUT'
      Origin = '"DETI_PODRAZD"."DPDATEOUT"'
    end
    object qTempOUTNOTE: TIBStringField
      DisplayLabel = #1050#1086#1084#1084#1077#1085#1090'. '#1074#1099#1073'.'
      FieldName = 'OUTNOTE'
      Origin = '"DETI_PODRAZD"."OUTNOTE"'
      Size = 255
    end
    object qTempDPUSERENTER: TIBStringField
      FieldName = 'DPUSERENTER'
      Origin = '"DETI_PODRAZD"."DPUSERENTER"'
      Size = 40
    end
    object qTempDPTIMEENTER: TDateTimeField
      FieldName = 'DPTIMEENTER'
      Origin = '"DETI_PODRAZD"."DPTIMEENTER"'
    end
    object qTempDPUSEREDIT: TIBStringField
      FieldName = 'DPUSEREDIT'
      Origin = '"DETI_PODRAZD"."DPUSEREDIT"'
      Size = 40
    end
    object qTempDPTIMEEDIT: TDateTimeField
      FieldName = 'DPTIMEEDIT'
      Origin = '"DETI_PODRAZD"."DPTIMEEDIT"'
    end
    object qTempPID1: TIntegerField
      FieldName = 'PID1'
      Origin = '"PEOPLE"."PID"'
    end
    object qTempLET: TLargeintField
      FieldName = 'LET'
      ProviderFlags = []
    end
    object qTempMES: TLargeintField
      FieldName = 'MES'
      ProviderFlags = []
    end
    object qTempSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qTempPODR: TIBStringField
      FieldName = 'PODR'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qTempPLASTNAME: TIBStringField
      DisplayLabel = #1060#1072#1084#1080#1083#1080#1103
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qTempPNAME: TIBStringField
      DisplayLabel = #1048#1084#1103
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qTempPPATRONYMIC: TIBStringField
      DisplayLabel = #1054#1090#1095#1077#1089#1090#1074#1086
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qTempPDATEBIRTH: TDateField
      DisplayLabel = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qTempOSN_PODR: TIBStringField
      FieldName = 'OSN_PODR'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object IBUpdateSQL1: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  DPID,'
      '  PID,'
      '  SDID,'
      '  DPDATEIN,'
      '  INNOTE,'
      '  DPDATEOUT,'
      '  OUTNOTE,'
      '  DPUSERENTER,'
      '  DPTIMEENTER,'
      '  DPUSEREDIT,'
      '  DPTIMEEDIT,'
      '  PID1,'
      '  PLASTNAME,'
      '  PNAME,'
      '  PPATRONYMIC,'
      '  PDATEBIRTH,'
      '  PP,'
      '  LET,'
      '  MES,'
      '  SDNAME,'
      '  STEP_ACT,'
      '  PODR,'
      '  OSN_PODR'
      'from DETI_PODRAZD_MISC '
      'where'
      '  DPID = :DPID')
    ModifySQL.Strings = (
      'update DETI_PODRAZD_MISC'
      'set'
      '  DPDATEIN = :DPDATEIN,'
      '  DPDATEOUT = :DPDATEOUT,'
      '  DPID = :DPID,'
      '  INNOTE = :INNOTE,'
      '  OUTNOTE = :OUTNOTE,'
      '  PID = :PID,'
      '  SDID = :SDID'
      'where'
      '  DPID = :OLD_DPID')
    InsertSQL.Strings = (
      'insert into DETI_PODRAZD_MISC'
      '  (DPDATEIN, DPDATEOUT, DPID, INNOTE, OUTNOTE, PID, SDID)'
      'values'
      '  (:DPDATEIN, :DPDATEOUT, :DPID, :INNOTE, :OUTNOTE, :PID, :SDID)')
    DeleteSQL.Strings = (
      'delete from DETI_PODRAZD_MISC'
      'where'
      '  DPID = :OLD_DPID')
    Left = 856
    Top = 72
  end
  object dsTree: TDataSource
    DataSet = qTree
    Left = 288
    Top = 336
  end
  object qTmp: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT DP.*,  P.PID, P.PLASTNAME, P.PNAME, P.PPATRONYMIC, P.PDAT' +
        'EBIRTH,  (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39'))' +
        ' AS PP, IIF((DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) ' +
        '-'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)-1,'
      '     DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)) AS let,'
      '     IIF( (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, 12 + (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)), ' +
        '(DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) )' +
        ' AS mes,'
      '     SD.SDNAME, SD1.SDNAME AS step_act,'
      '     SD3.SDNAME AS podr, SD4.SDNAME AS osn_podr'
      'FROM DETI_PODRAZD_MISC DP'
      'INNER JOIN PEOPLE P ON P.PID = DP.PID'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      'LEFT OUTER JOIN P_STEPACT PA ON PA.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD1 ON SD1.SDID = PA.PSTEP'
      'LEFT OUTER JOIN SYS_DIC SD3 ON SD3.SDID = DP.SDID'
      
        'LEFT OUTER JOIN DETI_PODRAZD DPM ON DPM.PID = P.PID AND :data BE' +
        'TWEEN CAST(dpm.DPDATEIN AS DATE) AND COALESCE(CAST(dpm.DPDATEOUT' +
        ' AS DATE), CURRENT_DATE+3650)'
      'LEFT OUTER JOIN SYS_DIC SD4 ON SD4.SDID = DPM.SDID'
      
        'WHERE :data BETWEEN CAST(DP.DPDATEIN AS DATE) AND COALESCE(CAST(' +
        'DP.DPDATEOUT AS DATE), CURRENT_DATE+3650)'
      ' and P.PISDELETE IS NULL ')
    GeneratorField.Field = 'DPID'
    Left = 824
    Top = 104
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'data'
        ParamType = ptUnknown
      end>
    object IntegerField1: TIntegerField
      FieldName = 'DPID'
      Origin = '"DETI_PODRAZD"."DPID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object IntegerField2: TIntegerField
      FieldName = 'PID'
      Origin = '"DETI_PODRAZD"."PID"'
    end
    object IntegerField3: TIntegerField
      FieldName = 'SDID'
      Origin = '"DETI_PODRAZD"."SDID"'
    end
    object DateTimeField1: TDateTimeField
      FieldName = 'DPDATEIN'
      Origin = '"DETI_PODRAZD"."DPDATEIN"'
    end
    object IBStringField1: TIBStringField
      FieldName = 'INNOTE'
      Origin = '"DETI_PODRAZD"."INNOTE"'
      Size = 255
    end
    object DateTimeField2: TDateTimeField
      FieldName = 'DPDATEOUT'
      Origin = '"DETI_PODRAZD"."DPDATEOUT"'
    end
    object IBStringField2: TIBStringField
      FieldName = 'OUTNOTE'
      Origin = '"DETI_PODRAZD"."OUTNOTE"'
      Size = 255
    end
    object IBStringField3: TIBStringField
      FieldName = 'DPUSERENTER'
      Origin = '"DETI_PODRAZD"."DPUSERENTER"'
      Size = 40
    end
    object DateTimeField3: TDateTimeField
      FieldName = 'DPTIMEENTER'
      Origin = '"DETI_PODRAZD"."DPTIMEENTER"'
    end
    object IBStringField4: TIBStringField
      FieldName = 'DPUSEREDIT'
      Origin = '"DETI_PODRAZD"."DPUSEREDIT"'
      Size = 40
    end
    object DateTimeField4: TDateTimeField
      FieldName = 'DPTIMEEDIT'
      Origin = '"DETI_PODRAZD"."DPTIMEEDIT"'
    end
    object IntegerField4: TIntegerField
      FieldName = 'PID1'
      Origin = '"PEOPLE"."PID"'
    end
    object IBStringField5: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
    object LargeintField1: TLargeintField
      FieldName = 'LET'
      ProviderFlags = []
    end
    object LargeintField2: TLargeintField
      FieldName = 'MES'
      ProviderFlags = []
    end
    object IBStringField6: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IBStringField7: TIBStringField
      FieldName = 'STEP_ACT'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object IBStringField8: TIBStringField
      FieldName = 'PODR'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object qPhoto: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PP.*'
      'from P_PHOTOS PP'
      'WHERE PP.PID = :pid')
    Left = 56
    Top = 384
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'pid'
        ParamType = ptUnknown
      end>
    object qPhotoPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_PHOTOS"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPhotoPPIMAGE: TBlobField
      FieldName = 'PPIMAGE'
      Origin = '"P_PHOTOS"."PPIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qPhotoPPNOTE: TIBStringField
      FieldName = 'PPNOTE'
      Origin = '"P_PHOTOS"."PPNOTE"'
      Size = 255
    end
    object qPhotoPPUSERENTER: TIBStringField
      FieldName = 'PPUSERENTER'
      Origin = '"P_PHOTOS"."PPUSERENTER"'
      Size = 40
    end
    object qPhotoPPTIMEENTER: TDateTimeField
      FieldName = 'PPTIMEENTER'
      Origin = '"P_PHOTOS"."PPTIMEENTER"'
    end
    object qPhotoPPUSEREDIT: TIBStringField
      FieldName = 'PPUSEREDIT'
      Origin = '"P_PHOTOS"."PPUSEREDIT"'
      Size = 40
    end
    object qPhotoPPTIMEEDIT: TDateTimeField
      FieldName = 'PPTIMEEDIT'
      Origin = '"P_PHOTOS"."PPTIMEEDIT"'
    end
  end
  object dsPhoto: TDataSource
    DataSet = qPhoto
    Left = 24
    Top = 384
  end
  object dsVizit: TDataSource
    DataSet = qVizit
    Left = 24
    Top = 600
  end
  object qVizit: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PV.*'
      'FROM P_VIZIT PV'
      ''
      'WHERE PV.PID = :PID')
    GeneratorField.Field = 'TFID'
    Left = 56
    Top = 600
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qVizitPVID: TIntegerField
      FieldName = 'PVID'
      Origin = '"P_VIZIT"."PVID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qVizitPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_VIZIT"."PID"'
    end
    object qVizitPVTARGET: TIntegerField
      FieldName = 'PVTARGET'
      Origin = '"P_VIZIT"."PVTARGET"'
    end
    object qVizitPVTIME_IN: TDateTimeField
      FieldName = 'PVTIME_IN'
      Origin = '"P_VIZIT"."PVTIME_IN"'
    end
    object qVizitPVTIME_OUT: TDateTimeField
      FieldName = 'PVTIME_OUT'
      Origin = '"P_VIZIT"."PVTIME_OUT"'
    end
    object qVizitPVPRIZNAK_IN: TIntegerField
      FieldName = 'PVPRIZNAK_IN'
      Origin = '"P_VIZIT"."PVPRIZNAK_IN"'
    end
    object qVizitPVPRIZNAK_OUT: TIntegerField
      FieldName = 'PVPRIZNAK_OUT'
      Origin = '"P_VIZIT"."PVPRIZNAK_OUT"'
    end
    object qVizitPVNOTE: TIBStringField
      FieldName = 'PVNOTE'
      Origin = '"P_VIZIT"."PVNOTE"'
      Size = 255
    end
    object qVizitPVUSERENTER: TIBStringField
      FieldName = 'PVUSERENTER'
      Origin = '"P_VIZIT"."PVUSERENTER"'
      Size = 40
    end
    object qVizitPVTIMEENTER: TDateTimeField
      FieldName = 'PVTIMEENTER'
      Origin = '"P_VIZIT"."PVTIMEENTER"'
    end
    object qVizitPVUSEREDIT: TIBStringField
      FieldName = 'PVUSEREDIT'
      Origin = '"P_VIZIT"."PVUSEREDIT"'
      Size = 40
    end
    object qVizitPVTIMEEDIT: TDateTimeField
      FieldName = 'PVTIMEEDIT'
      Origin = '"P_VIZIT"."PVTIMEEDIT"'
    end
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT P.PID, P.PLASTNAME, P.PNAME, P.PPATRONYMIC, P.PDATEBIRTH,' +
        ' (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAME,'#39' '#39')) AS PP, ' +
        'IIF((DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)-1,'
      '     DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE)) AS let,'
      '     IIF( (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) <' +
        ' 0, 12 + (DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)), ' +
        '(DATEDIFF( MONTH FROM P.PDATEBIRTH to CURRENT_DATE) -'
      
        '     (DATEDIFF( YEAR FROM P.PDATEBIRTH to CURRENT_DATE) * 12)) )' +
        ' AS mes,'
      '     SD1.SDNAME AS osn_podr'
      'FROM PEOPLE P'
      'LEFT OUTER JOIN P_STATUS PS ON PS.PID = P.PID'
      'LEFT OUTER JOIN SYS_DIC SD ON SD.SDID = PS.SDID'
      
        'LEFT OUTER JOIN DETI_PODRAZD DP ON DP.PID = P.PID AND CURRENT_DA' +
        'TE BETWEEN CAST(dp.DPDATEIN AS DATE) AND COALESCE(CAST(dp.DPDATE' +
        'OUT AS DATE), CURRENT_DATE+3650)'
      'LEFT OUTER JOIN SYS_DIC SD1 ON SD1.SDID = DP.SDID'
      'WHERE PS.SDID = 1246 and P.PISDELETE IS NULL'
      'AND UPPER(P.PLASTNAME) LIKE UPPER(:lastname)||'#39'%'#39
      'order by 2')
    Left = 432
    Top = 680
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'lastname'
        ParamType = ptUnknown
      end>
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePLASTNAME: TIBStringField
      DisplayLabel = #1060#1072#1084#1080#1083#1080#1103
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePNAME: TIBStringField
      DisplayLabel = #1048#1084#1103
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      DisplayLabel = #1054#1090#1095#1077#1089#1090#1074#1086
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      DisplayLabel = #1044#1072#1090#1072' '#1088#1086#1078#1076'.'
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 511
    end
    object qPeopleLET: TLargeintField
      DisplayLabel = #1051#1077#1090
      FieldName = 'LET'
      ProviderFlags = []
    end
    object qPeopleMES: TLargeintField
      DisplayLabel = #1052#1077#1089
      FieldName = 'MES'
      ProviderFlags = []
    end
    object qPeopleOSN_PODR: TIBStringField
      FieldName = 'OSN_PODR'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
  end
  object SD1: TSaveDialog
    InitialDir = 'c:\'
    Options = [ofOverwritePrompt, ofHideReadOnly, ofEnableSizing]
    Left = 1136
    Top = 192
  end
  object dsSC: TDataSource
    DataSet = qSC
    Left = 1017
    Top = 544
  end
  object qSC: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      
        'SELECT SC.SCID, SC.SCDATEBEGIN, SC.SCDATEEND, ST.STNAME, S.SCOUN' +
        'T'
      'FROM SPEC_COND SC'
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      'INNER JOIN SERVICES S ON S.SCID = SC.SCID'
      'INNER JOIN SERV_PODR_LINK SPL ON SPL.STID = S.STID'
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID'
      'WHERE SC.SCISDELETE IS NULL'
      'AND A.AGISDELETE IS NULL'
      
        'AND :date BETWEEN SC.SCDATEBEGIN AND COALESCE(sc.SCDATERASTORJ, ' +
        'SC.SCDATEEND)'
      'AND APU.PID = :PID'
      'AND SPL.SDID = :sdid')
    Left = 1058
    Top = 545
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'date'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end
      item
        DataType = ftUnknown
        Name = 'sdid'
        ParamType = ptUnknown
      end>
    object qSCSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"SPEC_COND"."SCID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qSCSCDATEBEGIN: TDateField
      FieldName = 'SCDATEBEGIN'
      Origin = '"SPEC_COND"."SCDATEBEGIN"'
    end
    object qSCSCDATEEND: TDateField
      FieldName = 'SCDATEEND'
      Origin = '"SPEC_COND"."SCDATEEND"'
    end
    object qSCSTNAME: TIBStringField
      FieldName = 'STNAME'
      Origin = '"SERVICES_TYPE"."STNAME"'
      Size = 255
    end
    object qSCSCOUNT: TIntegerField
      FieldName = 'SCOUNT'
      Origin = '"SERVICES"."SCOUNT"'
    end
  end
end
